package Thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.BlockingQueue;

public class Demo3 {
    //阻塞队列的基本用法：
    public static void main(String[] args) throws InterruptedException{
        //BlockingDeque<String> bq= (BlockingDeque<String>) new ArrayBlockingQueue<String>(100);
        BlockingQueue<String> bq=new ArrayBlockingQueue(100);
        String str="aaa";
        //String考点
        bq.put(str);
        String res=bq.take();
        System.out.println(res);
        String res1=bq.take();
        System.out.println(res1);
    }
}
